package main

import (
	"fgo/advance/db/gorm/models"
	"github.com/google/martian/log"
)

func main() {
	log.SetLevel(log.Debug)

	db := models.NewDb()
	// Scan
	type Result struct {
		Name string
		Age  int
	}

	var result []Result
	db.Raw("SELECT name, age FROM user WHERE id >  ? limit 100", 1).Scan(&result)
	//  SELECT name, age FROM user WHERE id >  1 limit 100

	log.Infof("%+v", result)
}
